package com.user.basic.analyze.handler;

import com.entity.analyze.RegisterType;
import com.entity.user.Sex;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;

import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

@MappedJdbcTypes(JdbcType.TINYINT)
@MappedTypes(RegisterType.class)
public class RegisterTypeHandler extends BaseTypeHandler<RegisterType> {
    @Override
    public void setNonNullParameter(PreparedStatement ps, int i, RegisterType parameter, JdbcType jdbcType) throws SQLException {
        ps.setInt(i, parameter.getIndex());
    }

    @Override
    public RegisterType getNullableResult(ResultSet rs, String columnName) throws SQLException {
        return null;
    }

    @Override
    public RegisterType getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
        return null;
    }

    @Override
    public RegisterType getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
        return null;
    }
}
